package com.bac.rentmap.web.controller.ad.search;

import java.util.List;
import java.util.logging.Logger;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.bac.rentmap.web.util.PathVariableParser;

/**
 * This controller validates and puts search parameters into model. It does not
 * perform actual search. Used to display map search result.
 * 
 * @author Andrew Osipenko
 */
public class DummyFlatAdSearchController extends SimpleFormController{
	private static final Logger log = Logger
			.getLogger(DummyFlatAdSearchController.class.getName());

	@Override
	protected ModelAndView onSubmit(Object searchParameters) throws Exception {
		log.fine("Filter parameters " + searchParameters);
		ModelAndView res = new ModelAndView(getSuccessView());
		res.addObject("searchParameters", searchParameters);
		return res;
	}

	@Override
	protected boolean isFormSubmission(HttpServletRequest request) {
		return true;
	}

	@Override
	protected ServletRequestDataBinder createBinder(HttpServletRequest request,
			Object command) throws Exception {
		// TODO Remove later
		return super.createBinder(request, command);
	}

}
